-
Notifications
You must be signed in to change notification settings - Fork 592
HDDS-5366. [Ozone-Streaming] Implement stream method to ContainerStateMachine. #2358
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
szetszwo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@captainzmc , thanks a lot for working on this. Just have a minor comment.
BTW, let me update the HDDS-4454 branch with master. Please update your branch as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should make it async like below:
public CompletableFuture<DataStream> stream(RaftClientRequest request) {
return CompletableFuture.supplyAsync(() -> {
try {
ContainerCommandRequestProto requestProto =
getContainerCommandRequestProto(gid,
request.getMessage().getContent());
DispatcherContext context =
new DispatcherContext.Builder()
.setStage(DispatcherContext.WriteChunkStage.WRITE_DATA)
.setContainer2BCSIDMap(container2BCSIDMap)
.build();
ContainerCommandResponseProto response = runCommand(
requestProto, context);
String path = response.getMessage();
return new LocalStream(new StreamDataChannel(Paths.get(path))));
} catch (IOException e) {
throw new CompletionException("Failed to create data stream", e);
}
}, executor);
}
44f95ae to
51dd9c5
Compare
szetszwo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 the change looks good.
|
Thanks @szetszwo for the review. |
…eMachine. (#2358). Contributed by mingchao zhao
…eMachine. (apache#2358). Contributed by mingchao zhao
…eMachine. (apache#2358). Contributed by mingchao zhao
…eMachine. (apache#2358). Contributed by mingchao zhao
…eMachine. (#2358). Contributed by mingchao zhao
…eMachine. (#2358). Contributed by mingchao zhao
…eMachine. (#2358). Contributed by mingchao zhao
…eMachine. (#2358). Contributed by mingchao zhao
…eMachine. (#2358). Contributed by mingchao zhao
…eMachine. (#2358). Contributed by mingchao zhao
…eMachine. (#2358). Contributed by mingchao zhao
…eMachine. (#2358). Contributed by mingchao zhao
…eMachine. (#2358). Contributed by mingchao zhao
…eMachine. (#2358). Contributed by mingchao zhao
…eMachine. (#2358). Contributed by mingchao zhao
…eMachine. (#2358). Contributed by mingchao zhao
…eMachine. (#2358). Contributed by mingchao zhao
…eMachine. (#2358). Contributed by mingchao zhao
…eMachine. (#2358). Contributed by mingchao zhao
…eMachine. (apache#2358). Contributed by mingchao zhao
…eMachine. (#2358). Contributed by mingchao zhao
…eMachine. (#2358). Contributed by mingchao zhao
…eMachine. (#2358). Contributed by mingchao zhao
…eMachine. (apache#2358). Contributed by mingchao zhao
…eMachine. (apache#2358). Contributed by mingchao zhao (cherry picked from commit d4bf89a)
What changes were proposed in this pull request?
Use RATIS-Streaming to make ContainerStateMachine support writing streaming to the local.
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-5366
How was this patch tested?
CI test will be added after the client is finished